#include <bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
const int mod=998244353;

int f91(int a)
{
	if(a>=101)
	{
		return a-10;
	}
	else
	{
		return f91(f91(a+11));
	}
}

int main()
{
	ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);

	int a;
	cin >> a;
	cout << f91(a) << endl;
    return 0;
}

